<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>
<body>
<nav th:replace="layouts::navbar"></nav>


<div class="container">
    <div class="logo"></div>
    <hr>
    <h3>当前销售单</h3>
    <br>
    <a th:href="@{/sales/new}" class="btn btn-primary btn-sm mb-3">新增销售</a>
    <br>
    <table class="table table-bordered table-striped">
        <thead class="thead-dark">
        <tr>
            <th>销售ID</th>
            <th>销售时间</th>
            <th>销售员工</th>
            <th>活动</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="aSale : ${saleHeads}">
            <td th:text="${aSale.saleId}"></td>
            <td th:text="${aSale.data}"></td>
            <td th:text="${aSale.name}"></td>

            <td>
                <a th:href="@{/sales/update(id=${aSale.saleId})}" class="btn btn-info btn-sm">更新</a>
                <a
                        th:href="@{/sales/delete(id=${aSale.saleId})}"
                        class="btn btn-danger btn-sm"
                        onclick="if(!(confirm('你确定删除这个销售单吗'))) return false"
                >删除</a>
            </td>
        </tr>
        </tbody>
    </table>

</div>

</body>
</html>